package com.demo.enums;

/**
 * 消息状态 0未处理 1已处理
 */
public enum MessageStatusEnum {
    UN_HANDLE(0, "未处理"),
    HANDLED(1, "已处理");

    private int value;
    private String desc;

    MessageStatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static MessageStatusEnum getByValue(Integer value) {
        for (MessageStatusEnum item : values()) {
            if (item.getValue() == value) {
                return item;
            }
        }
        return null;
    }
}
